﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Cache-Control" content="No-Cache">
	<meta http-equiv="Pragma" content="No-Cache">
	
	<title>운세의신</title>

	<link rel="stylesheet" type="text/css" href="/css/master.css" />
	<link rel="stylesheet" type="text/css" href="/css/mypage.css"/>
	
	<script type="text/javascript">
		function search() {
			var frm = document.frm;
			if (frm.user_id.value == '') {
				alert("검색할 회원의 아이디를 입력하세요.");
				return false;
			}
			if (frm.user_id.value == '<?=$sess_userinfo['user_id']?>') {
				alert("본인에게는 선물할 수 없습니다.");
				return false;
			}
			frm.submit();
		}
		
		function give(target_id) {
			var frm2 = document.frm2;
			frm2.target_user_id.value = target_id;

			frm2.submit();
		}
	</script>

</head>
<body>
<form name="frm2" id="frm2" method="post" action="/mypage/vip/confirm">
	<input type="hidden" name="target_user_id" id="target_user_id" />
</form>
<div id="wrap">
	<div class="pop">
		<form name="frm" id="frm" method="post" action="/mypage/vip/search_member">
			<fieldset>
				
				<h1><img src="/images/mypage/ptit_gift.png" alt="vip이용권선물하기" /></h1>
				<p class="zigline"></p>
				<!--서브타이틀-->
				<div class="contents">
					<h2>회원찾기</h2>
					<p class="popText">운세의신 회원 중에서 선물할 친구를 찾아보세요.</p>
					<div class="box2">
						<p>
							<em>아이디</em>
							<input type="text" size="20" name="user_id" id="user_id" title="아이디를 입력하세요" class="inpText" />
							<a href="javascript:search()"><img src="/images/common/bt_seach.png" alt="검색" align="absmiddle" /></a>
						</p>
					</div><!--box2-->
					
					<!--회원검색이 되었을시-->
					<? if (!empty($list) && count($list) > 0) : ?>
					<div class="result">
						<span class="text">운세의신 회원이 검색되었습니다.</span>
						<? foreach ($list as $item) : ?>
						<dl class="first end">
							<dt><img src="/images/common/s_user.jpg" alt="회원이미지" /></dt>
							<dd class="id"><span><?=$item['user_id']?></span>님</dd>
							<dd class="date">가입일<span><?=substr($item['create_dt'],0,10)?></span></dd>
							<dd class="bt_gift"><a href="javascript:give('<?=$item['user_id']?>')"><img src="/images/mypage/bt_gift.png" alt="선물하기" /></a></dd>
						</dl>
						<? endforeach ?>
					</div><!--result-->
					<!--
					<div class="result">
						<span class="text"><em>3명</em>의 운세의신 회원이 검색되었습니다.</span>
						<dl class="first">
							<dt><img src="/images/common/s_user.jpg" alt="회원이미지" /></dt>
							<dd class="id"><span>schosun</span>님</dd>
							<dd class="date">가입일<span>2012-06-05</span></dd>
							<dd class="bt_gift"><a href="pop_vip2.html"><img src="/images/mypage/bt_gift.png" alt="선물하기" /></a></dd>
						</dl>
						<dl>
							<dt><img src="/images/common/s_user.jpg" alt="회원이미지" /></dt>
							<dd class="id"><span>schosun</span>님</dd>
							<dd class="date">가입일<span>2012-06-05</span></dd>
							<dd class="bt_gift"><a href="#"><img src="/images/mypage/bt_gift.png" alt="선물하기" /></a></dd>
						</dl>
						<dl class="end">
							<dt><img src="/images/common/s_user.jpg" alt="회원이미지" /></dt>
							<dd class="id"><span>schosun</span>님</dd>
							<dd class="date">가입일<span>2012-06-05</span></dd>
							<dd class="bt_gift"><a href="#"><img src="/images/mypage/bt_gift.png" alt="선물하기" /></a></dd>
						</dl> 
					</div>--><!--result-->
					<!--//회원검색이 되었을시-->
				
					<? elseif (!empty($list)) : ?>
					<!--회원검색이 안되었을시-->
					<div class="result_no">
						<span class="text_no">조건에 만족하는 운세의신 회원이 없습니다.<br />아이디를 확인해주세요.</span>
					</div><!--result-->
					<!--//회원검색이 안되었을시-->
					<? endif ?>
				</div>
			</fieldset>
		</form>
		<!--하단--> 
	</div>
	<!--pop--> 
</div>
<!--전체-->
</body>
</html>